import { kgjHttp as http } from '@/services/http';
// import type { SkuResult, SkuReqParam } from '@/types/api/crm-kgj/sku';
import type { SortAndLimit, ListResult } from '@/types/api/common';

/** 获取商品列表 */
export const getSkuList = (payload: { data: any; params: SortAndLimit }) =>
  http<ListResult<any>, any, SortAndLimit>({
    url: '/api/gold-crm/sku/list',
    method: 'post',
    ...payload
  });

/** 商品关联橱窗列表 */
export const getSkuWindowList = (productId: string, params: SortAndLimit) =>
  http<ListResult<any>, any, SortAndLimit>({
    url: '/api/gold-crm/sku/shop-author/{productId}',
    method: 'get',
    params,
    args: {
      productId
    }
  });

/** 下架商品 */
export const getSkuDown = (id: string) =>
  http<ListResult<any>>({
    url: '/api/gold-crm/sku/down/{id}',
    method: 'delete',
    args: {
      id
    }
  });

/** 批量下架商品 */
export const getMultiSkuDown = (data: any) =>
  http<ListResult<any>, any>({
    url: '/api/gold-crm/sku/multi-down',
    method: 'post',
    data
  });

/** 上架商品 */
export const reqSkuPut = (id: string) =>
  http<ListResult<any>>({
    url: `/api/gold-crm/sku/put/${id}`,
    method: 'post'
  });
/** 批量上架商品 */
export const reqMultiSkuPut = (data: any) =>
  http<ListResult<any>, any>({
    url: '/api/gold-crm/sku/multi-put',
    method: 'post',
    data
  });
